<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <!--{include file='comm/header.tpl'}-->
    <!--{include file="comm/icheck.tpl"}-->
    <title>商品评论处理</title>
    <style type="text/css">
        .col-sm-9 {
            padding-top: 7px;
        }
    </style>
<script>

	var source = {
		
		//检测是否填写表单
		check: function(){
			var answerInfo = E.trim($('#answer_content').val());
			var recommendFlg = $('input:radio[name="recommend"]:checked').val();
			var display = $('input:radio[name="display"]:checked').val();
			var error_msg = '';
			if (answerInfo == ''){
				error_msg += '回复不能为空<br/>';
			}
			if (recommendFlg == ''){
				error_msg += '请选择首页是否显示<br/>';
			}
			
			if (display == ''){
				error_msg += '请选择显示控制<br/>';
			}
			if (error_msg != ''){
				E.alert(error_msg,1);
			}else {
				E.confirm("您确认回复该评论吗？", "source.edit");
			}
		},
		
		edit: function(){
			var dt = E.getFormValues('addForm');
			$.ajax({
					type: "POST",
                    url: "/invokingAjax-backend/content/comment.ajax?operFlg=2",
					dataType: "JSON",
					data:dt,
					success: function( result_obj ) {
                    if (result_obj.code == 200) {
                        E.opener("source.load");
                        E.alert(result_obj.message,  2, "E.closeWindows");
                    } else {
                        E.alert(result_obj.message);
                    }
                }
			});
		}
	};
</script>
</head>
<body>
	<div style="width:100%">
		<div class="items clearfix">
			<h2 style="" class="tal">商品评论处理</h2>
			
			<div class="items2">
        		
				<!--{if $error_msg}-->

	            <div class="comm-box">
	                <div style="position:relative;color: red;">
	                    <!--{$error_msg}-->
	                </div>
	            </div>
	
	            <!--{else}-->
				
        		<form id="addForm" name="addForm" class="form-horizontal" onsubmit="return false;">

                    <div class="form-group">
                        <label class="col-sm-3 control-label">
                            会员：
                        </label>
                        <div class="col-sm-9">
                            <!--{$custID.custID}-->
                        </div>

                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label">
                            提交时间：
                        </label>
                        <div class="col-sm-9">
                            <!--{$commentInfo.createTime}-->


                        </div>

                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label">
                            评价：
                        </label>
                        <div class="col-sm-9">
                            <!--{$comment_item_str}-->
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label">
                            评论内容：
                        </label>
                        <div class="col-sm-9">
                            <!--{$commentInfo.comment_content}-->
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label">
                            IP地址：
                        </label>
                        <div class="col-sm-9">
                            <!--{$commentInfo.ip}-->
                        </div>
                    </div>



                    <div class="form-group">
                        <label class="col-sm-3 control-label" for="answer_content">
                            评论回复：
                        </label>
                        <div class="col-sm-9">
                            <textarea style="height:80px;" name="answer_content" id="answer_content" class="form-control"><!--{$commentInfo.answer_content}--></textarea>
                        </div>
                    </div>

                    <div class="form-group" style="display: none">
                        <label class="col-sm-3 control-label" for="selectorType">
                            满意度：
                        </label>
                        <div class="col-sm-9">
                            <input type="radio" class="square-radio" id="di_0" name="satisfaction" value="0" <!--{if $commentInfo.satisfaction == 0}--> checked="checked" <!--{/if}-->><label for="di_0">&nbsp;不满意</label>&nbsp;
                            <input type="radio" class="square-radio" id="di_1" name="satisfaction" value="1" <!--{if $commentInfo.satisfaction == 1}--> checked="checked" <!--{/if}-->><label for="di_1">&nbsp;满意</label>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label" for="selectorType">
                            网站显示控制：
                        </label>
                        <div class="col-sm-9">
                            <input type="radio" class="square-radio" id="dis_1" name="display" value="0" <!--{if $commentInfo.display == 0}--> checked="checked" <!--{/if}-->><label for="dis_1">&nbsp;仅咨询人可见</label>&nbsp;
                            <input type="radio" class="square-radio" id="dis_2" name="display" value="1" <!--{if $commentInfo.display == 1}--> checked="checked" <!--{/if}-->><label for="dis_2">&nbsp;所有人可见</label>
                        </div>
                    </div>

                    <div class="form-group" style="display: none">
                        <label class="col-sm-3 control-label" for="selectorType">
                            首页推荐：
                        </label>
                        <div class="col-sm-9">
                            <input type="radio" class="square-radio" id="rec_1" name="recommend" value="0" <!--{if $commentInfo.recommend == 0}--> checked="checked" <!--{/if}-->><label for="rec_1">&nbsp;不推荐</label> &nbsp;
                            <input type="radio" class="square-radio" id="rec_2" name="recommend" value="1" <!--{if $commentInfo.recommend == 1}--> checked="checked" <!--{/if}-->><label for="rec_2">&nbsp;推荐</label>
                        </div>
                    </div>


                    <input type="hidden" name="comment_id" value="<!--{$commentInfo.comment_id|default:0}-->">

				</form>
				
				<!--{/if}-->
				
        	</div>
		</div>
		
		<div class="bottom_fixbox">
	        <div class="rectbox tac">
	        	<input type="button" class="btn" onclick="source.check();" value="处理">
				<input type="button" class="btn" onclick="E.closeWindows();" value="关闭">
	        </div>
	    </div>
	</div>

<script type="text/javascript">
    $('.square-radio').iCheck({
        checkboxClass: 'icheckbox_square-blue',
        radioClass: 'iradio_square-blue',
        increaseArea: '20%' // optional
    });

</script>
</body>
</html>